package com.xxl.job.executor.utils;

import java.util.List;
import java.util.Map;
import java.util.Vector;


//工具类  返回 map 中的value集合
public class MapUtil {

    public static <T>List<T> getLikeByMap(Map<String, T> map, String keyLike){
        List<T> list=new Vector<T>();
        for (Map.Entry<String, T> entity : map.entrySet()) {
            if(entity.getKey().indexOf(keyLike)>-1){
                list.add((T) entity.getValue());
            }
        }
        return list;
    }

    public static <T> List<T> getLikeByMap(Map<String, T> map) {

        List<T> list = new Vector<T>();

        for (Map.Entry<String, T> entity : map.entrySet()) {

            list.add((T) entity.getValue());
        }
        return list;
    }
}
